﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZhiJiao.Service.Abstracts;

namespace ZhiJiao.Service.Services
{
    public class OrderService:IOrderService
    {
        public string GenerateOrderNumber()
        { 
            DateTime now = DateTime.Now;
            string year = now.Year.ToString();
            string month = now.Month.ToString("D2");
            string day = now.Day.ToString("D2");
            string hour = now.Hour.ToString("D2");
            string minute = now.Minute.ToString("D2");
            string second = now.Second.ToString("D2");

            var random = new Random();
            int number = random.Next(1000,10000);
            return $"{year}{month}{day}{hour}{minute}{second}{number}";
        }
    }
}
